<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>业务输出</title>
    <%@ include file="../common/meta.jsp" %>
    <link href="${ctx}/css/page/common-list.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/page/common-search.css?t=${now}" rel="stylesheet">
    <style>
    </style>
    <script>
        var searchInfo = ${searchInfo};
        var statusMap = ${statusMap};
        var destTypeMap = ${destTypeMap};
    </script>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="tabs-container">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5><i class="fa fa-search"></i> 筛选查询</h5>
                    </div>
                    <div class="ibox-content ibox-content-search">
                        <form class="form-horizontal m-t" id="searchForm" novalidate="novalidate">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">输出平台：</label>
                                <div class="col-sm-2">
                                    <select class="form-control" name="destType" id="destType" onchange="doRefresh()">
                                        <option value="">--请选择--</option>
                                        <c:forEach items="${destTypeMap}" var="item">
                                            <option value="${item.code}" ${not empty searchInfo && searchInfo.destType == item.code? 'selected' : '' } >${item.name}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                                <label class="col-sm-1 control-label">查询业务：</label>
                                <div class="col-sm-2">
                                    <input type="text" name="bizName" onkeydown="if(event.keyCode==13){doRefresh();return false;}" id="bizName" class="form-control"  placeholder="输入业务" maxlength="30"
                                           value="${not empty searchInfo ? searchInfo.bizName : ''}">
                                </div>
                                <label class="col-sm-1 control-label">查询栏目：</label>
                                <div class="col-sm-2">
                                    <input type="text" name="columnName" onkeydown="if(event.keyCode==13){doRefresh();return false;}" id="columnName" class="form-control"  placeholder="输入栏目名称" maxlength="30"
                                           value="${not empty searchInfo ? searchInfo.columnName : ''}">
                                </div>
                                <div class="ibox-tools ibox-tools-search">
                                    <button type="button" class="btn btn-primary btn-outline" onclick="doRefresh()">查询</button>
                                    <button type="button" class="btn btn-primary btn-outline" onclick="clearFrom('searchForm')">重置</button>
                                    <button type="button" class="btn btn-primary btn-outline" onclick="openSearchTools();"><i class="fa fa-caret-down"></i></button>
                                </div>
                            </div>
                            <div class="search-tools">
                                <div class="form-group">
                                    <label class="col-sm-1 control-label">状态：</label>
                                    <div class="col-sm-2">
                                        <select class="form-control" name="status" id="status" onchange="doRefresh()">
                                            <option value="">--请选择--</option>
                                            <c:forEach items="${statusMap}" var="item">
                                                <option value="${item.key}" ${not empty searchInfo && searchInfo.status == item.key? 'selected' : '' } >${item.value}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                    <label class="col-sm-1 control-label">服务商：</label>
                                    <div class="col-sm-2">
                                        <select class="form-control" name="isvPid" id="isvPid" onchange="doRefresh()">
                                            <option value="">--请选择--</option>
                                            <c:forEach items="${isvMap}" var="item">
                                                <option value="${item.code}" ${not empty searchInfo && searchInfo.isvPid == item.code? 'selected' : '' } >${item.name}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                    <label class="col-sm-1 control-label">服务项：</label>
                                    <div class="col-sm-2">
                                        <select class="form-control" name="bizCode" id="bizCode" onchange="doRefresh()">
                                            <option value="">--请选择--</option>
                                            <c:forEach items="${cBizMap}" var="item">
                                                <option value="${item.code}" ${not empty searchInfo && searchInfo.bizCode == item.code? 'selected' : '' } >${item.name}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                    <label class="col-sm-1 control-label">城市：</label>
                                    <div class="col-sm-2">
                                        <select class="form-control" name="cityCode" id="cityCode" onchange="doRefresh()">
                                            <option value="">--请选择--</option>
                                            <c:forEach items="${cityMap}" var="item">
                                                <option value="${item.code}" ${not empty searchInfo && searchInfo.cityCode == item.code? 'selected' : '' } >${item.name}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-1 control-label">关联一级科室：</label>
                                    <div class="col-sm-2">
                                        <select class="form-control" name="deptCode" id="deptCode" onchange="doRefresh()">
                                            <option value="">--请选择--</option>
                                            <c:forEach items="${deptMap}" var="item">
                                                <option value="${item.code}" ${not empty searchInfo && searchInfo.deptCode == item.code? 'selected' : '' } >${item.name}</option>
                                            </c:forEach>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5><i class="fa fa-table"></i> 业务管理</h5>
                        <div class="ibox-tools col-sm-offset-2">
                            <c:if test="${userType == 'super' || not empty btnMap['createLink']}">
                                <button class="btn btn-primary btn-outline" onclick="createOutputLink()">生成链接</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['addOutput']}">
                                <button class="btn btn-primary btn-outline" onclick="openAddOutputPage()">新增</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['editOutput']}">
                                <button class="btn btn-primary btn-outline" onclick="openEditOutputPage()">编辑</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['delOutput']}">
                                <button class="btn btn-primary btn-outline" onclick="deleteOutput()">删除</button>
                            </c:if>
                            <button class="btn btn-primary btn-outline" onclick="doLeftRefresh()">刷新</button>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <table class='table table-striped table-hover'
                               id="leftTable" data-height="400"
                               data-toggle="table"
                               data-url="${ctx}/output/pageFindOutputData?t=${now}"
                               data-pagination="true"
                               data-side-pagination="server"
                               data-striped="true"
                               data-response-handler="handleServerResult"
                               data-query-params-type=""
                               data-query-params="getLeftParams"
                               data-page-number="${not empty searchInfo.pageNo ? searchInfo.pageNo : 1}"
                               data-page-size="${not empty searchInfo.pageSize ? searchInfo.pageSize : defaultPageSize}"
                               data-page-list="${pageList}">
                            <thead>
                            <tr>
                                <th data-field="status" data-visible="false">状态</th>
                                <th data-field="bizCode" data-visible="false">业务编码</th>
                                <th data-field="id" data-align="center" data-width="90px" data-formatter="initCheck">渠道服务ID</th>
                                <th data-field="bizName" data-align="center" data-width="80px">业务</th>
                                <th data-field="cBizName" data-align="center" data-width="110px">业务服务项</th>
                                <th data-field="destType" data-align="center" data-width="110px" data-formatter="destTypeFormat">输出平台</th>
                                <th data-field="creator" data-align="center" data-width="90px" data-formatter="formatterCreator">创建人</th>
                                <th data-field="operator" data-visible="false">创建人</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
            <div class="col-sm-6" style="padding-left: 0px;">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5><i class="fa fa-table"></i> 栏目管理</h5>
                        <div class="ibox-tools col-sm-offset-2">
                            <c:if test="${userType == 'super' || not empty btnMap['stateColumn']}">
                                <button class="btn btn-primary btn-outline" id="_setStateBtn" onclick="setState()">上架</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['addColumn']}">
                                <button class="btn btn-primary btn-outline" onclick="openAddColumnPage()">新增</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['editColumn']}">
                                <button class="btn btn-primary btn-outline" onclick="openEditColumnPage()">编辑</button>
                            </c:if>
                            <c:if test="${userType == 'super' || not empty btnMap['delColumn']}">
                                <button class="btn btn-primary btn-outline" onclick="deleteColumn()">删除</button>
                            </c:if>
                            <button class="btn btn-primary btn-outline" onclick="doRightRefresh()">刷新</button>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <table class='table table-striped table-hover'
                               id="dataTable" data-height="400"
                               data-toggle="table"
                               data-url="${ctx}/output/pageFindColumnData?t=${now}"
                               data-pagination="true"
                               data-side-pagination="server"
                               data-striped="true"
                               data-response-handler="handleServerResult"
                               data-query-params-type=""
                               data-query-params="getRightParams"
                               data-page-number="${not empty searchInfo.pageNoCol ? searchInfo.pageNoCol : 1}"
                               data-page-size="${not empty searchInfo.pageSizeCol ? searchInfo.pageSizeCol : defaultPageSize}"
                               data-page-list="${pageList}">
                            <thead>
                            <tr>
                                <th data-field="id" data-visible="false">栏目id</th>
                                <th data-field="status" data-formatter="formatStatus" data-align="center" data-width="90px">状态</th>
                                <th data-field="columnName" data-align="center" data-width="120px">栏目名称</th>
                                <th data-field="grade" data-formatter="formatGrade" data-align="center" data-width="120px">栏目层级</th>
                                <th data-field="sortNum" data-align="center" data-width="90px">排序</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="text-center">${companyName}</div>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/output/outputNewMgr.js?t=${now}"></script>
</body>
</html>


